
EXE=hello.exe
OBJ=$(SRC:.c=.o)
SRC=$(wildcard *.c)
CC=gcc
ECH=echo
RM=rm -rf


$(EXE):$(OBJ)
		@$(ECH) ""
		@$(ECH) ""
		@$(ECH) "开始编译"
		@$(CC) -o $@ $^
		@$(ECH) "linking $^ generated $@ ... done" 
		@$(ECH) "编译成功"
		@$(ECH) ""

%.o:%.c
		@$(CC) -c $<
		@$(ECH) "compling $< to $@ ... done"


.PHONY: clean
clean:
		@$(ECH) "开始清理"
		@$(RM) $(OBJ) $(EXE)
		@$(ECH) "clean $(EXE) ... done"
		@$(ECH) "清理完成"


